chore(repo): Update rolldown and tsdown#8207
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| "require": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.js" | ||
| "types": "./dist/index.d.cts", |
There was a problem hiding this comment.
I do think it's somewhat strange that tsdown emits both mts and cts files. I would have thought that the CJS files would be js since the package doesn't have "type": "module". After looking into the config for tsdown it does appear that this is to be expected though. When you emit a cjs bundle, tsdown defaults platform to "node", which forces the fixedExtensions config to be true. So it does seem like this is intentional for dual ESM+CJS packages.
| @@ -1,5 +1,5 @@ | |||
| import { PageMocking, type MockScenario } from '@clerk/msw'; | |||
| import * as l from '../../localizations'; | |||
| import * as l from '../../localizations/src'; | |||
There was a problem hiding this comment.
This was added to match the ui import below.
| @@ -1,4 +1,4 @@ | |||
| export { TokenCache } from './types'; | |||
| export type { TokenCache } from './types'; | |||
There was a problem hiding this comment.
This prevents an error where TokenCache was expected to be a non-type value.
Description
Updates rolldown and tsdown to their latest versions. This surfaced several issues with our type system, which have been resolved in this PR:
@clerk/shared, usingtscinstead of bundling types withtsdown. This prevents issues where the same type was pulled fromdist/typesanddist/runtime.tsc, the@/path alias was removed in favor of relative imports. We can explore using"imports"inpackage.jsonin a future PR if we know that every runtime@clerk/sharedsupports has support for that.@clerk/reactby pointing the"require""types"field to the emitted CJS type bundle.Uitype in the@clerk/reactpackage that allows the bundledUitype and the one used by the@clerk/uipackage to match, preventing TypeScript from complaining that the types don't match.turbo.jsonto factor intsdown.config.mtsinto whether or not to invalidate the cache.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change